<?php defined('IN_PHPCMS') or exit('Access Denied'); ?><?php include template('space', 'header'); ?>
<link href="<?php echo SKIN_PATH;?>modal.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="images/js/jqModal.js"></script>
<script type="text/javascript" src="<?php echo $M['url'];?>images/js/space.js"></script>
<div id="main">
  <div id="left">
    <div id="space">
      <h5>个人资料</h5>
      <img src="<?php echo $avatar;?>" alt="<?php echo $username;?>" height="150" width="150"/>
      <div id="memberinfo">
       <p>
  用户名：<a href="<?php echo $MODULE['member']['url'];?>view.php?userid=<?php echo $userid;?>"><?php echo $username;?></a><br />
  最后登录：<?php echo date('Y-m-d H:i', $lastlogintime);?>
  </p>
    </div>
      <ol><?php if($is_host) { ?><li class="msg"><a href="<?php echo $MODULE['message']['url'];?>inbox.php" class="msg">查看短消息</a></li><?php } ?><li class="edit"><a href="<?php echo $MODULE['message']['url'];?>send.php?userid=<?php echo $userid;?>" class="edit">写短消息</a></li></ol>
      <div class="clear"></div>
    </div>
    <ol>
      <li class="local"><a href="<?php echo SITE_URL;?>">返回网站首页</a></li>
      <?php if($is_host) { ?><li class="exit"><a href="<?php echo $MODULE['member']['url'];?>logout.php">退出登录</a></li><?php } ?>
    </ol>
  </div>
  <div id="right">
  <?php if($is_host) { ?><div id="model"><a href="javascript:void(0);" class="blockcontrol" id="blockcontrol">空间管理</a></div><?php } ?>
<p id="position"> <strong>当前位置：</strong><a href="">首页</a><?php echo $spacename;?></p>
    <?php if(is_array($blockinfo)) foreach($blockinfo AS $i => $api) { ?>
    <div id="block_<?php echo $api['apiid'];?>" class="modellist_2">
      <h3>
        <span class="f_r"><a href="#" id="more_url_<?php echo $api['apiid'];?>"><img src="images/more.gif" alt="更多"/></a></span>
        <?php echo $api['name'];?><?php if($is_host) { ?>&nbsp;<a href="javascript:void(0);" onClick="javascript:close_block('<?php echo $api['apiid'];?>');" style="font-size:12px; font-weight:normal; margin-left:15px;">[关闭]</a><?php } ?>
      </h3>
 
      <div id="block_pic_<?php echo $api['apiid'];?>" class="modellist_2_1">
      </div>
      <div id="block_words_<?php echo $api['apiid'];?>" class="modellist_2_2">
      </div>
      <div class="clear"></div>
    </div>
    <?php } ?>
  </div>
</div>
<div class="clear"></div>
<span id="toggle_pannel"></span>
<?php include template('member', 'footer'); ?>
<script language="javascript">
url = "<?php echo $M['url'];?>block.php?userid=<?php echo $_userid;?>"
$('#toggle_pannel').jqm({ajax:url,modal:false,trigger: 'a.blockcontrol'});
<?php if(is_array($blockinfo)) foreach($blockinfo AS $i => $api) { ?>
block(<?php echo $api['apiid'];?>, "<?php echo $api['url'];?>", <?php echo $userid;?>)
<?php } ?>

function close_block(id)
{
$.get("<?php echo $M['url'];?>block.php", {action:'del', userid:<?php echo $_userid;?>, blockid: id}, function(data) {
});
id = '#block_' + id;
$(id).hide();
}
</script>